package com.example.service.impl;

import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.entity.Modules;
import com.example.entity.Roles;
import com.example.entity.RolesVO;
import com.example.entity.TreeMenu;
import com.example.mapper.RolesMapper;
import com.example.service.RolesService;
@Service
public class RolesServiceImpl implements RolesService{

	@Autowired
	private RolesMapper rolesMapper;

	
	/**
	 * 角色按条件查询
	 */
	@Override
	public List<Roles> findAllRoles(RolesVO rolesVO) {
		// TODO Auto-generated method stub
		return rolesMapper.findAllRoles(rolesVO);
	}
    /**
     * 返回的条数
     */
	@Override
	public int getCount(RolesVO rolesVO) {
		// TODO Auto-generated method stub
		return rolesMapper.getCount(rolesVO);
	}
    /**
     * 删除角色
     */
	@Override
	public int delRoles(int id) {
		// TODO Auto-generated method stub
		return rolesMapper.delRoles(id);
	}
    /**
     * 添加角色
     */
	@Override
	public int addroles(Roles roles) {
		// TODO Auto-generated method stub
		return rolesMapper.addroles(roles);
	}
   /*
    * 修改角色
    */
	@Override
	public int upRoles(Roles roles) {
		// TODO Auto-generated method stub
		return rolesMapper.upRoles(roles);
	}
//	@Override
//	public List<Modules> selectmodulesAll() {
//		// TODO Auto-generated method stub
//		return rolesMapper.selectmodulesAll();
//	}
//	@Override
//	public List<Modules> getModulesByUid(Integer moduleid,String roleids) {
//		// TODO Auto-generated method stub
//		return rolesMapper.getModulesByUid(moduleid, roleids);
//	}
//	
	@Override
	public List<TreeMenu> selectAllTree(Integer rolesIds) {
		// TODO Auto-generated method stub
		return rolesMapper.selectAllTree(rolesIds);
	}

	@Override
	public int deleteByUidAndModuleid(String roleid, String moduleid) {
		// TODO Auto-generated method stub
		return rolesMapper.deleteByUidAndModuleid(roleid, moduleid);
	}

	@Override
	public int insertByUidAndModuleid(String id, String roleid, String moduleid) {
		// TODO Auto-generated method stub
		return rolesMapper.insertByUidAndModuleid(id, roleid, moduleid);
	}
	

}
